package jsyf.oa.entity.system;

import com.alibaba.fastjson.JSONObject;
import jsyf.oa.ientity.BaseEntity;

import javax.persistence.Entity;
import javax.persistence.Table;
import java.io.Serializable;

/**
 * Created by Maqiuqiu on 2018/7/21.
 */
@Entity
@Table(name = "T_SYS_MESSAGE", schema = "oa", catalog = "")
public class MessageEntity extends BaseEntity implements Serializable {

    private String createUserId;
    private String content;
    private String mainId;
    private String openUrl;
    private String openTitle;
    private Integer messageType;

    public String getCreateUserId() {
        return createUserId;
    }

    public void setCreateUserId(String createUserId) {
        this.createUserId = createUserId;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public String getMainId() {
        return mainId;
    }

    public void setMainId(String mainId) {
        this.mainId = mainId;
    }

    public String getOpenUrl() {
        return openUrl;
    }

    public void setOpenUrl(String openUrl) {
        this.openUrl = openUrl;
    }

    public String getOpenTitle() {
        return openTitle;
    }

    public void setOpenTitle(String openTitle) {
        this.openTitle = openTitle;
    }

    public Integer getMessageType() {
        return messageType;
    }

    public void setMessageType(Integer messageType) {
        this.messageType = messageType;
    }

    @Override
    public JSONObject getJSONObject() {
        JSONObject json = new JSONObject();
        json.put("ID", this.getId());
        json.put("CREATE_USER_ID", this.getCreateUserId());
        json.put("CREATE_TIME", this.getCreateTime());
        json.put("CONTENT", this.getContent());
        json.put("OPEN_URL", this.getOpenUrl());
        json.put("OPEN_TITLE", this.getOpenTitle());
        json.put("MESSAGE_TYPE", this.getMessageType());
        json.put("MAIN_ID", this.getMainId());
        json.put("DEL_FLAG", getDelFlag());
        return json;
    }

    @Override
    public String getTableName() {
        return "T_SYS_MESSAGE";
    }

    @Override
    public String getViewName() {
        return "V_SYS_MESSAGE";
    }

    @Override
    public JSONObject getJSONColumns() {
        JSONObject json = new JSONObject();
        json.put("ID", "id");
        json.put("CREATE_USER_ID", "createUserId");
        json.put("CREATE_TIME", "createTime");
        json.put("CONTENT", "content");
        json.put("OPEN_URL", "openUrl");
        json.put("OPEN_TITLE", "openTitle");
        json.put("MESSAGE_TYPE", "messageType");
        json.put("MAIN_ID", "mainId");
        json.put("DEL_FLAG", "delFlag");
        return json;
    }
}
